﻿@model QuaLuuNiem.Models.BAIVIET

@{
    ViewBag.Title = "CapNhatBaiViet";
    Layout = "~/Views/Shared/_layoutDangnhap.cshtml";
}
<div class="center_center">
    <div class="center_danhsach">
<h2>Cập nhật bài viết</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/tinymce/jscripts/tiny_mce/tiny_mce.js")" type="text/javascript"></script>

 <script type="text/javascript">
     tinyMCE.init({ mode: "textareas", theme: "advanced", skin: "o2k7", theme_advanced_toolbar_location: "top",
         plugins: "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
         theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
         theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
         theme_advanced_toolbar_location: "top",
         theme_advanced_toolbar_align: "left",
         theme_advanced_statusbar_location: "bottom",
         theme_advanced_resizing: true
     });
    </script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)


            @Html.HiddenFor(model => model.MaBaiViet)

            <div class="insert">
            <label>Tên bài viết</label>

            @Html.EditorFor(model => model.TenBaiViet)
            @Html.ValidationMessageFor(model => model.TenBaiViet)
            </div>
        <div class="insert">
        <label>Nội dung</label>
            @Html.TextAreaFor(model => model.NoiDung)
            @Html.ValidationMessageFor(model => model.NoiDung)
        </div>
    
            @Html.HiddenFor(model => model.NgayViet)
            @Html.HiddenFor(model => model.Hinh)

        <div class="insert">
        <label>Trạng Thái</label>
            <select name="TrangThai" id="TrangThai" >
            @if (Model.TrangThai == 1)
            {
                <option value="1" selected="selected">Duyệt</option>
                <option value="0">Chưa duyệt</option>
            }
            @if (Model.TrangThai == 0)
            {
                <option value="1" >Duyệt</option>
                <option value="0" selected="selected">Chưa duyệt</option>
            }
            </select>
        </div>
        <p class="button">
            <input type="submit" value="Lưu lại" />
        </p>
}
    @Html.ActionLink("Quay lại trang danh sách", "danh_sach_bai_viet")

</div>
</div>

